From 105c808d0acefbe03a8c8f5a3c8a31636b38edd8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 18 Mar 2013 08:36:04 -0400 Subject: [PATCH] Small cleanup in gtk_window_draw Get the allocation once, at the beginning. --- gtk/gtkwindow.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index d1455014f9..edcbb53638 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -8850,6 +8850,8 @@ gtk_window_draw (GtkWidget *widget, context = gtk_widget_get_style_context (widget); + gtk_widget_get_allocation (widget, &allocation); + if (priv->title_box != NULL) get_decoration_borders (widget, &title_border, &inner_border, &outer_border); else @@ -8859,7 +8861,6 @@ gtk_window_draw (GtkWidget *widget, gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget))) { gtk_style_context_save (context); - gtk_style_context_add_class (context, GTK_STYLE_CLASS_BACKGROUND); if (priv->client_decorated && @@ -8867,7 +8868,6 @@ gtk_window_draw (GtkWidget *widget, !priv->fullscreen && !(gdk_window_get_state (gtk_widget_get_window (widget)) & GDK_WINDOW_STATE_MAXIMIZED)) { - gtk_widget_get_allocation (widget, &allocation); gtk_style_context_add_class (context, "window-border"); gtk_render_background (context, cr, inner_border.left + outer_border.left, @@ -8890,7 +8890,6 @@ gtk_window_draw (GtkWidget *widget, } else { - gtk_widget_get_allocation (widget, &allocation); gtk_render_background (context, cr, 0, 0, allocation.width, allocation.height); } -- 2.30.2